//
//  CustomMenuItem.m
//  ChunLaiZhuangClient
//
//  Created by zouzhisheng on 16/2/23.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "CustomMenuItem.h"
@interface CustomMenuItem()
@property(nonatomic, strong) UILabel *numLabel;
@end

@implementation CustomMenuItem
- (id)initWithFrame:(CGRect)frame num:(NSString*)num name:(NSString*)name
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor=[UIColor whiteColor];
        UILabel *numLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 10,self.width,24)];
        numLabel.text=num;
        numLabel.font=[UIFont boldSystemFontOfSize:22];
        numLabel.textAlignment=NSTextAlignmentCenter ;
        numLabel.textColor=[UIColor colorWithHexString:@"000000"];
        UILabel *nameLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, numLabel.bottom,self.width,24)];
        nameLabel.text=name;
        nameLabel.font=[UIFont systemFontOfSize:14];
        nameLabel.textAlignment=NSTextAlignmentCenter ;
        nameLabel.textColor=[UIColor colorWithHexString:@"000000"];
        [self addSubview:numLabel];
        [self addSubview:nameLabel];
        self.numLabel = numLabel;
    }
    return self;
}

- (void)updateNumLabel:(NSInteger)number {
    self.numLabel.text = [NSString stringWithFormat:@"%ld", number];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
